package com.ycode.bang.anbang.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ycode.bang.anbang.MyApp;
import com.ycode.bang.anbang.R;
import com.ycode.bang.anbang.baseui.BaseActivity;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by maosongsong on 2016/4/5.
 */
public class AcceptOrderActivity extends BaseActivity implements View.OnClickListener {
    @InjectView(R.id.title)
    TextView title;

    @InjectView(R.id.lin_one)
    LinearLayout mLinOne;
    @InjectView(R.id.lin_two)
    LinearLayout mLinTwo;
    @InjectView(R.id.lin_three)
    LinearLayout mLinThree;
    @InjectView(R.id.lin_four)
    LinearLayout mLinFour;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_accept_order);
        ButterKnife.inject(this);
        initView();
    }

    public void initView() {
        if (!MyApp.instance.isManage()){
            mLinFour.setVisibility(View.GONE);
        }
        title.setText("受理工单");
        mLinOne.setOnClickListener(this);
        mLinTwo.setOnClickListener(this);
        mLinThree.setOnClickListener(this);
        mLinFour.setOnClickListener(this);
    }

    @Override
    protected void getSuccessRequest(Object response, int flag) {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.lin_one:
                Intent intentone = new Intent(this, AcceptPublicOrderActivity.class);
                startActivity(intentone);
                break;
            case R.id.lin_two:
                Intent intenttwo = new Intent(this, AcceptPersonalOrderActivity.class);
                startActivity(intenttwo);
                break;
            case R.id.lin_three:
                Intent intentthree = new Intent(this, ComplaintsActivity.class);
                startActivity(intentthree);
                break;
            case R.id.lin_four:
                Intent intentfour = new Intent(this, AdviceActivity.class);
                startActivity(intentfour);
                break;
        }
    }
}
